<#include "header.htm"/>
<#import "../macros/pagination.ftl" as pagination>
<#import "../macros/presentation.ftl" as presentation/>

<link rel="alternate" type="application/rss+xml" title="RSS" href="${contextPath}/rss/recentTopics${extension}" />
<script type="text/javascript" src="${contextPath}/templates/${templateName}/js/pagination.js?${startupTime}"></script>
			
			 <table  style="margin-top:10px;" width="100%" border="0">
					<tr> 
					      <td align="left"> 
					        <span class="nav">
							<a   href="${JForumContext.encodeURL("/forums/list")}">${I18n.getMessage("ForumListing.forumIndex")}</a>
							&raquo;
							<a   href="${JForumContext.encodeURL("/allTopics/list")}">${I18n.getMessage("ForumBase.allForum")}</a>
							<#if rssEnabled>
								&nbsp;<a href="${contextPath}/rss/recentTopics${extension}"><img src="${contextPath}/templates/${templateName}/images/xml_button.gif" border="0" align="middle" alt="[XML]" /></a>
							</#if>
							</span>
						  </td>	
						 <td align="right"><@presentation.forumsComboTable/></td>
					</tr>
			 </table>
			 <table style="margin-top:5px;" width="100%">		
				    <tr>
					  <td valign="middle" align="left" >
					   <a href="${JForumContext.encodeURL("/jforum${extension}?module=posts&amp;action=insert&amp;forum_id=0", "")}" rel="nofollow" class="icon_new_topic"><img src="${contextPath}/images/transp.gif" alt="" /></a>	
                      </td>
					
<#--				<#if logged> -->
                   <td align="right" nowrap="nowrap">		                    
					  <select name="selectSort" id="selectSort" onchange="if(this.options[this.selectedIndex].value != 0){ 
				                	document.location =  '${contextPath}/allTopics/list/0/'+ this.options[this.selectedIndex].value +'${extension}';}
				       else {document.location =  '${contextPath}/allTopics/list/0'+'${extension}';}" >
						
						<option value="0">${I18n.getMessage("ForumBase.search.chooseSortby")}...</option>	
						<option value="1" <#if selectIndex?? && selectIndex==1>selected="true"</#if>>${I18n.getMessage("ForumBase.search.sortByPublishTime")}</option>			
                        <option value="2" <#if selectIndex?? && selectIndex==2>selected="true"</#if>>${I18n.getMessage("ForumBase.search.sortByPostCount")}</option>
                        <option value="3"<#if selectIndex?? && selectIndex==3>selected="true"</#if> >${I18n.getMessage("ForumBase.search.sortByPostTime")}</option>
					  </select>
			        </td>
<#--			     </#if>   -->
					 <td class="nav"   align="right" nowrap="nowrap">
					  
		  				<#assign paginationData><@pagination.doPagination "list",-1/></#assign>
						${paginationData}
					  </td>
					 
					</tr>
				</table>
			 
			
			<table class="forumline" cellspacing="1" cellpadding="1" width="100%" border="0">
				<tr>
				    <th class="thtop" nowrap="nowrap" align="center">&nbsp;${I18n.getMessage("ForumBase.state")}&nbsp;</th>			
					<th class="thcornerl"   nowrap="nowrap" align="center" width="120" >&nbsp;${I18n.getMessage("Forums.Form.ForumName")}&nbsp;</th>
					<th class="thtop" align="center"   >&nbsp;${I18n.getMessage("ForumIndex.topics")}&nbsp;</th>
					<th class="thtop" nowrap="nowrap" align="center" width="50">&nbsp;${I18n.getMessage("ForumIndex.answers")}&nbsp;</th>
					<th class="thtop" nowrap="nowrap" align="center" width="100" >&nbsp;${I18n.getMessage("ForumIndex.author")}&nbsp;</th>
					<th class="thtop" nowrap="nowrap" align="center" width="50" >&nbsp;${I18n.getMessage("ForumIndex.views")}&nbsp;</th>
					<th class="thcornerr" nowrap="nowrap" align="center" width="100">&nbsp;${I18n.getMessage("ForumIndex.lastMessage")}&nbsp;</th>
				</tr>

				<!-- TOPICS LISTING -->
				<#list topics as topic>
				<#assign rowbg><@presentation.rowbg topic/></#assign>
				<tr>
					<td bgcolor="${rowbg}"  valign="middle" align="center" width="26"><@presentation.folderImage topic/></td>
					<td bgcolor="${rowbg}"  valign="middle" align="center"  width="120" ><a class="postdetails" href="${JForumContext.encodeURL("/forums/show/${forums.get(topic_index).getId()}")}" target="_blank">${forums.get(topic_index).getName()}</a></td>
					<td bgcolor="${rowbg}"    onmouseover="style.backgroundColor='#F5EFFB'" onmouseout="style.backgroundColor='${rowbg}'" >
						 
						<a class="topictitle" href="${JForumContext.encodeURL("/posts/list/${topic.id}${extension}?fromAll=0","")}" target="_blank" title="最后回复(${topic.lastPostBy.username}):${topic.lastPostText}"><#if (topic.title?length == 0)>${I18n.getMessage("ForumBase.noTopic")}<#else>${topic.title?html}</#if></a>
						 
					<td bgcolor="${rowbg}"  valign="middle" align="center" nowrap="nowrap"><span class="name">${topic.totalReplies}</span></td>
					<td bgcolor="${rowbg}"  valign="middle" align="center" nowrap="nowrap">
					    <span class="name">
					      ${topic.firstPostTime} <br />
						 <a href="${JForumContext.encodeURL("/user/profile/${topic.postedBy.id}")}" target="_blank">${topic.postedBy.username}</a></span>
					    
					</td>
					<td bgcolor="${rowbg}"  valign="middle" nowrap="nowrap" align="center"><span class="name">${topic.totalViews}</span></td>
					<td bgcolor="${rowbg}"  valign="middle" nowrap="nowrap" align="center">
						<#if (topic.lastPostTime?length > 0)>
							<span class="name">${topic.lastPostTime}<br />
							<a href="${JForumContext.encodeURL("/user/profile/${topic.lastPostBy.id}")}" target="_blank">${topic.lastPostBy.username}</a>

							<#assign startPage = ""/>
							<#if (topic.totalReplies + 1 > postsPerPage?number)>
								<#assign startPage = ((topic.totalReplies / postsPerPage?number)?int * postsPerPage?number) +"/"/>
							</#if>
				            
							<a href="${JForumContext.encodeURL("/posts/list/${startPage}${topic.id}")}?fromAll=0#${topic.lastPostId}" target="_blank"><img src="${contextPath}/templates/${templateName}/images/icon_latest_reply.gif" border="0" alt="Latest Reply" /></a></span>
						</#if>		 
					</td>
				</tr>
				</#list>		
				<!-- END OF TOPICS LISTING -->
			</table>  
				 <table cellspacing="2" cellpadding="2" width="100%" align="center" border="0">
					<tr>
					   <td valign="middle" align="left" width="50">
					     <a  href="${JForumContext.encodeURL("/jforum${extension}?module=posts&amp;action=insert&amp;forum_id=0", "")}" rel="nofollow" class="icon_new_topic"><img src="${contextPath}/images/transp.gif" alt="" /></a>	
					   </td>
					   <td valign="middle"  align="left">
					      <a class="nav" href="${JForumContext.encodeURL("/forums/list")}">${I18n.getMessage("ForumListing.forumIndex")}</a>&raquo;
					      <a class="nav" href="${JForumContext.encodeURL("/allTopics/list")}">${I18n.getMessage("ForumBase.allForum")}</a>
                          <#if rssEnabled>
						     &nbsp;<a href="${contextPath}/rss/recentTopics${extension}"><img src="${contextPath}/templates/${templateName}/images/xml_button.gif" border="0" align="middle" alt="[XML]" /></a>
					       </#if>
 
						</td>
					    <td class="nav" nowrap="nowrap" align="right">
		  				   <#assign paginationData><@pagination.doPagination "list",-1/></#assign>
						   ${paginationData}
					    </td>
					</tr>
				</table>		
<#include "bottom.htm"/>
